/*
day34
2019.10.1
*/


struct ListNode {
    int val;
    struct ListNode *next;
};
 


struct ListNode* removeElements(struct ListNode* head, int val){
	
    while(head&&head->val==val)
	{
		head=head->next;
	}
    
	struct ListNode *p=head;
	while(p&&p->next)
	{
		while(p->next && p->next->val==val)
		{
			p->next=p->next->next;
		}
        
		p=p->next;
	}
	
	return head;
}

int main()
{
	return 0;
}
